/**
 * 
 */
package niuke.练习赛15;

import java.util.Scanner;

/**
 * @author zhong
 *
 */
public class 吉姆的奇思妙想 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int M = scanner.nextInt();
		int L = scanner.nextInt();
		double freq[] = new double[L];
		double deg[] = new double[L];

		for (int i = 0; i < L; i++) {
			deg[i] = scanner.nextDouble();
			freq[i] = scanner.nextDouble();
		}

		int Q = scanner.nextInt();
		while (Q-- > 0) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
		}
	}

}
